import request from '@/utils/request'

//获取待我处理的申请列表
export  const  listExamine = (url,search) =>
    request({
        url,
        method: 'get',
        params: {
            pageSize: search.limit,
            keyWord: search.name,
            pageNo:search.currentPage
        } 
        

    })
//获取审批详情
export  const  detailExamine = (code,url)=>
    request({
        url,
        method: 'get',
        params:{
            code
        }

    })
//删除审批
export  const  del_Exa = (code) =>
    request({
        url: '/op/project_req/delete_project_req',
        method: 'get',
        params:{
            code
        }

    })


//项目发起 -all
export const Exa_setup = (url,prjCode,prdCode,reqFileList,reqDescription,reqName) => 
    request({
        url,
        method: 'post',
        data:JSON.stringify({
                prdCode,//产品code
        		prjCode,//项目code
        		reqFileList,
        		reqDescription,
        		reqName
        })

    })


 //重新发起申请
export const Re_exa_project = (code,url) => 
    request({
        url,
        method: 'get',
        params:{
                code   
        }
    })

//指派人 -all

 export  const  pointTouser = (url,code,userCode) =>
    request({
        url,
        method: 'get',
        params:{
            code,
            userCode,
        }
    })


//获取项目申请code
export  const  getExaCode = (prjCode,reqType) =>
    request({
        url: '/op/req/get_req_code_by_project_code',
        method: 'get',
        params:{
            prjCode,
            reqType,
        }

    })

//获取产品申请code
export  const  getExaCode_product = (prdCode,reqType) =>
    request({
        url: '/op/req/get_req_code_by_product_code',
        method: 'get',
        params:{
            prdCode,
            reqType,
        }

    })


export  const  sub_modify_Exa = (url,code,reqFileList,reqDescription) =>
    request({
        url,
        method: 'post',
        data:JSON.stringify({
                code,
                reqFileList,
                reqDescription
                
        })

    })

export  const  modify_Exa = (url,code,reqFileList,reqDescription) =>
    request({
        url,
        method: 'post',
        data:JSON.stringify({
                code,
                reqFileList,
                reqDescription
                
        })

    })


//部门负责人审批-all
export  const  setup_wait_minister = (url,code,opinion,fileCode,approval,signatureImgCode) =>
    request({
        url,
        method: 'get',
        params:{
            code,
            opinion,
            fileCode,
            approval,
            signatureImgCode
        }
    })
//合规负责人
export  const  setup_wait_legal = (url,code,opinion,fileCode,approval,signatureImgCode) =>
    request({
        url,
        method: 'get',
        params:{
            code,
            opinion,
            fileCode,
            approval,
            signatureImgCode
        }
    })

//执行总经理审批
 export  const  setup_wait_Manage = (url,code,opinion,fileCode,approval,signatureImgCode) =>
    request({
        url,
        method: 'get',
        params:{
            code,
            opinion,
            fileCode,
            approval,
            signatureImgCode
        }
    })

//获取项目历史审批记录
export  const  getExaHistory = (prjCode) =>
    request({
        url:'/op/req/get_project_req_history',
        method: 'get',
        params:{
            prjCode
        }
    })

//获取产品历史审批记录
export  const  getExaHistory_product = (prdCode) =>
    request({
        url:'/op/req/get_product_req_history',
        method: 'get',
        params:{
            prdCode
        }
    })
//上传电子签名
export  const  upSign = (formData) =>
    
    request({
        url : process.env.BASE_API+'/op/fileupload/upload_file',
        method: 'post',
        data: formData,
    })

    
/*导出数据到Excel*/
export const exportE = () => 
    request({
        url: '/op/fileupload/export_excel?pageNo=1&pageSize=1000&dataType=2',
        method: 'get',
        responseType: 'blob'
    })


export const drawback_lift = (url,code) => 
    request({
        url,
        method: 'get',
        params:{
            code
        }
    })